package com.sjz.myfrist;


import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

/***
 *   Activity 之间传送数据  发送端  点击按钮后可以通过Intent传递数据
 */
public class ActSendActivity extends AppCompatActivity implements View.OnClickListener{

    private TextView tv_send;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_send);
        tv_send = findViewById(R.id.act_tv_send);
        findViewById(R.id.act_btn_send).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent intent = new Intent(this,ActReceiveActivity.class);
        //创建一个包裹
        Bundle bundle = new Bundle();
        bundle.putString("request_content",tv_send.getText().toString());
        intent.putExtras(bundle);
        startActivity(intent);
    }
}